std::bitset::flip

From Cppreference

Jump to: navigation, search
bitset<N>& flip();
(1)
bitset<N>& flip( size_t pos );
(2)

Flips bits, i.e. changes the value from true to false and the other way round. Equivalent to NOT operation and operator~()

1) Flips all bits.

2) Flips the bit at the position pos.

Contents

[edit] Parameters

pos - the position of the bit to flip

[edit] Return value

*this

[edit] Example

[edit] See also

set
sets bits to true or given value
(public member function)
reset
sets bits to false
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages